import VueRouter from 'vue-router'
//路由按需加载
function routeView (fileName, pathName) {
  return () => import(`@/web/${fileName}/${pathName}`)
}
import notFoundComponent from '@/web/404/404'//404
const routes = [
  { path: '*', component: notFoundComponent },  // 404
  { path: '/', component: routeView('login', 'webLogin'), name: '登录' },
  {
    path: '/main', component: routeView('index', 'index'),
    children: [
      { path: '/main', component: routeView('permissions', 'roleList'), name: '首页' },//首页
      { path: '/roleList', component: routeView('permissions', 'roleList'), name: '用户角色' },//用户角色
      { path: '/userList', component: routeView('permissions', 'userList'), name: '用户档案' },//用户档案
      { path: '/paramList', component: routeView('permissions', 'ParamList'), name: '参数管理' },//参数管理
      { path: '/dictList', component: routeView('permissions', 'DictList'), name: '字典管理' },//字典管理
      { path: '/articleList', component: routeView('permissions', 'ArticleList'), name: '资讯管理' },//文章管理
      { path: '/bannerList', component: routeView('permissions', 'BannerList'), name: 'Banner管理' },//Banner管理
      { path: '/team/:projectId', component: routeView('permissions', 'team'), name: '团队管理' },//团队管理

      { path: '/projectList', component: routeView('Businessmanagement', 'projectList'), name: '项目管理' },//项目管理
      { path: '/memberList', component: routeView('Businessmanagement', 'MemberList'), name: '用户管理' },//会员管理
      { path: '/rechargeList', component: routeView('Businessmanagement', 'RechargeList'), name: '充值管理' },//充值管理
      { path: '/cashList', component: routeView('Businessmanagement', 'CashList'), name: '提现管理' },//提现管理
      { path: '/balance', component: routeView('Businessmanagement', 'balance'), name: '余额明细' },//余额明细
      { path: '/contribution', component: routeView('Businessmanagement', 'contribution'), name: '贡献分明细' },//贡献分明细
      { path: '/paymentSetting', component: routeView('Businessmanagement', 'paymentSetting'), name: '支付设置' },//支付设置
      { path: '/orderList', component: routeView('Businessmanagement', 'orderList'), name: '订单管理' },//订单管理
      { path: '/productList', component: routeView('Businessmanagement', 'productList'), name: '商品管理' },//商品管理
      { path: '/categoryList', component: routeView('Businessmanagement', 'categoryList'), name: '主柜管理' },//分类管理
      { path: '/customizeList', component: routeView('Businessmanagement', 'customizeList'), name: '定制管理' },//分类管理
    ]
  }
]
export default new VueRouter({ routes })